package com.fly.modules.sys.controller;

import com.fly.modules.sys.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by SWan on 2017/4/5.
 */
@Controller
@RequestMapping("/sys/user/")
public class UserController {

  /*  @RequestMapping(value ="/user")
    public ModelAndView index(){
        System.out.println("index");
        ModelAndView mv = new ModelAndView("user");
        mv.addObject("username", "你好,FreeMarker");
        mv.addObject("userlist",getUserList());
        return mv;
    }*/

    private List<User> getUserList(){
        List<User> userList = new ArrayList<User>();
        for(int i = 0; i < 5; i++){
            String name = "用户" + i;
            User user = new User();
        //    user.setName(name);
         //   user.setBirthday(new Date());
            userList.add(user);
        }
        return userList;
    }

    @RequestMapping(value ="/index")
    public String index(){
        return "sys/right";
    }
}
